#pragma once


namespace IcyCrystal{
	/**
	* Class that reads buffers files.
	*/
	class FileReader {
	private:
		char* buffer;
		unsigned int currentPosition;
		unsigned int fileLength;
		string filename;

		unsigned int currentLine;

	public:
		FileReader();
		~FileReader();

		/** Reads the file from filename into memory */
		void readFile(const string& filename);

		/** Sets the current file position */
		void setPosition(unsigned int x);

		/** Gets the current file position */
		unsigned int getPosition();

		/** Returns the next character and advances the buffer */
		char next();

		/** Returns the next character without advancing the buffer */
		char peek();

		/** Returns the previous character and decreases the buffer */
		char prev();

		/** Returns the current line */
		unsigned int getCurrentLine();
	};

}
